﻿using wscf.lightblue;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.IO;

namespace wscf.lightblue.Test
{
	[TestClass()]
	public class XmlSchemaCreatorTest
	{
		[TestMethod()]
		public void CreateSchemaTest()
		{
			string filePath = "CreateSchemaTest.xsd";
			string schemaName = "CreateSchemaTest";
			string schemaNamespace = "http://wscf.lightblue.Test.CreateSchemaTest";
			XmlSchemaCreator.CreateSchema(filePath, schemaName, schemaNamespace);
			Assert.IsTrue(File.Exists("CreateSchemaTest.xsd"));
		}

		[TestMethod()]
		public void Generate_File()
		{
			string folder = Environment.CurrentDirectory;
			string file1 = XmlSchemaCreator.CreateSchema(folder);
			Assert.IsTrue(File.Exists(file1));
			string file2 = XmlSchemaCreator.CreateSchema(folder);
			Assert.IsTrue(File.Exists(file2));
			File.Delete(file1);
			File.Delete(file2);
		}
	}
}
